<!DOCTYPE html>
<?php
ob_start();
@session_start(); 
require_once("connect.php");
?>
<html>
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1' />
	<link rel="stylesheet"  type="text/css" href="bootstrap-3.1.1-dist/css/bootstrap.css" />
	<link rel="stylesheet"  type="text/css" href="css.css" />
	<link rel="stylesheet"  type="text/css" href="css/cssmenubar.css"/>
	<link rel="stylesheet"  type="text/css" href="cssviewtable.css"/>
</head>
<body>
	<?
		require_once('connect.php');
		
		$cus_id=$_REQUEST['cus_id'];
		$cus_name=$_REQUEST['cus_name'];
		$cus_lname=$_REQUEST['cus_lname'];
		$cus_tel=$_REQUEST['cus_tel'];
		$cus_add=$_REQUEST['cus_add'];
		$username=$_REQUEST['username'];
		
		$strSQL=" UPDATE customer
			SET cus_name = '$cus_name',
		    cus_lname = '$cus_lname',
			cus_tel = '$cus_tel',
			cus_add = '$cus_add',
			username = '$username'
		 where cus_id = '$cus_id'";
	
		
		#echo $strSQL."<br>";

		$result=mysql_query($strSQL);

	
		if($result)
		{ 
			echo " <script> alert('สำเร็จ');  window.location.assign('adminlogin.php')  </script>";
		}
		
		else {
			echo "<script> alert('เพิ่มข้อมมูลไม่สำเร็จ');  window.location.assign('edit_cus.php')  </script>";
		
		}
	
	?>


	

</body>
</html>